#INT_TIMER0 //high
void tmr0_isr(void)
{ 
    disable_interrupts(int_timer0);//T0IE=0;
    INJ_CLOSE;   //close injectors after timeinj
    out_parm.squirt = 0;
    latb_tmp        =(LATB&0xf0);
    return;
}

void firetime (unsigned int16 a)
{
    if (T0IE==0) {
        if (!bit_test(inj_ch,0)) {
            //if (swap_inj)
            INJ_OPEN_0;
            out_parm.squirt = 0x00000001;          // ch1 injector channels are open MS
        } else {
            INJ_OPEN_1;
            out_parm.squirt = 0x00000010;          // ch2 injector channels are open MS
        }
        latb_tmp=(LATB&0xf0);
        set_timer0(-a);
        //out_parm.squirt = 0x00000011;          // both injector channels are open MS
        clear_interrupt(INT_TIMER0);//T0IF=0;
        enable_interrupts(INT_TIMER0);//T0IE=1;
    }
    return;
}

void firetime_all (unsigned int16 a)
{
    if (T0IE==0) {
        INJ_OPEN_0;                         // ch1 injector channels are open MS
        INJ_OPEN_1;                         // ch2 injector channels are open MS
        latb_tmp=(LATB&0xf0);
        set_timer0(-a);
        out_parm.squirt = 0x00000011;       // both injector channels are open MS
        clear_interrupt(INT_TIMER0);        //T0IF=0;
        enable_interrupts(INT_TIMER0);      //T0IE=1;
    }
    return;
}

